/**
 *
 */
import Util;
import OpenApi;

import EndpointUtil;

extends OpenApi;

init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  @endpointMap = {
    ap-northeast-1 = 'gdb-api.aliyuncs.com',
    ap-northeast-2-pop = 'gdb-api.aliyuncs.com',
    ap-south-1 = 'gdb-api.ap-south-1.aliyuncs.com',
    ap-southeast-1 = 'gdb-api.ap-southeast-1.aliyuncs.com',
    ap-southeast-2 = 'gdb-api.aliyuncs.com',
    ap-southeast-3 = 'gdb-api.aliyuncs.com',
    ap-southeast-5 = 'gdb-api.ap-southeast-5.aliyuncs.com',
    cn-beijing = 'gdb-api.aliyuncs.com',
    cn-beijing-finance-1 = 'gdb-api.aliyuncs.com',
    cn-beijing-finance-pop = 'gdb-api.aliyuncs.com',
    cn-beijing-gov-1 = 'gdb-api.aliyuncs.com',
    cn-beijing-nu16-b01 = 'gdb-api.aliyuncs.com',
    cn-chengdu = 'gdb-api.aliyuncs.com',
    cn-edge-1 = 'gdb-api.aliyuncs.com',
    cn-fujian = 'gdb-api.aliyuncs.com',
    cn-haidian-cm12-c01 = 'gdb-api.aliyuncs.com',
    cn-hangzhou = 'gdb-api.aliyuncs.com',
    cn-hangzhou-bj-b01 = 'gdb-api.aliyuncs.com',
    cn-hangzhou-finance = 'gdb-api.aliyuncs.com',
    cn-hangzhou-internal-prod-1 = 'gdb-api.aliyuncs.com',
    cn-hangzhou-internal-test-1 = 'gdb-api.aliyuncs.com',
    cn-hangzhou-internal-test-2 = 'gdb-api.aliyuncs.com',
    cn-hangzhou-internal-test-3 = 'gdb-api.aliyuncs.com',
    cn-hangzhou-test-306 = 'gdb-api.aliyuncs.com',
    cn-hongkong = 'gdb-api.aliyuncs.com',
    cn-hongkong-finance-pop = 'gdb-api.aliyuncs.com',
    cn-huhehaote = 'gdb-api.aliyuncs.com',
    cn-huhehaote-nebula-1 = 'gdb-api.aliyuncs.com',
    cn-north-2-gov-1 = 'gdb-api.aliyuncs.com',
    cn-qingdao = 'gdb-api.aliyuncs.com',
    cn-qingdao-nebula = 'gdb-api.aliyuncs.com',
    cn-shanghai = 'gdb-api.aliyuncs.com',
    cn-shanghai-et15-b01 = 'gdb-api.aliyuncs.com',
    cn-shanghai-et2-b01 = 'gdb-api.aliyuncs.com',
    cn-shanghai-finance-1 = 'gdb-api.aliyuncs.com',
    cn-shanghai-inner = 'gdb-api.aliyuncs.com',
    cn-shanghai-internal-test-1 = 'gdb-api.aliyuncs.com',
    cn-shenzhen = 'gdb-api.aliyuncs.com',
    cn-shenzhen-finance-1 = 'gdb-api.aliyuncs.com',
    cn-shenzhen-inner = 'gdb-api.aliyuncs.com',
    cn-shenzhen-st4-d01 = 'gdb-api.aliyuncs.com',
    cn-shenzhen-su18-b01 = 'gdb-api.aliyuncs.com',
    cn-wuhan = 'gdb-api.aliyuncs.com',
    cn-wulanchabu = 'gdb-api.aliyuncs.com',
    cn-yushanfang = 'gdb-api.aliyuncs.com',
    cn-zhangbei-na61-b01 = 'gdb-api.aliyuncs.com',
    cn-zhangjiakou = 'gdb-api.cn-zhangjiakou.aliyuncs.com',
    cn-zhangjiakou-na62-a01 = 'gdb-api.aliyuncs.com',
    cn-zhengzhou-nebula-1 = 'gdb-api.aliyuncs.com',
    eu-central-1 = 'gdb-api.aliyuncs.com',
    eu-west-1 = 'gdb-api.aliyuncs.com',
    eu-west-1-oxs = 'gdb-api.aliyuncs.com',
    me-east-1 = 'gdb-api.aliyuncs.com',
    rus-west-1-pop = 'gdb-api.aliyuncs.com',
    us-east-1 = 'gdb-api.aliyuncs.com',
    us-west-1 = 'gdb-api.aliyuncs.com',
  };
  checkConfig(config);
  @endpoint = getEndpoint('gdb', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }

  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model AllocateInstancePublicConnectionRequest {
  connectionStringPrefix?: string(name='ConnectionStringPrefix'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AllocateInstancePublicConnectionResponseBody = {
  requestId?: string(name='RequestId'),
}

model AllocateInstancePublicConnectionResponse = {
  headers: map[string]string(name='headers'),
  body: AllocateInstancePublicConnectionResponseBody(name='body'),
}

async function allocateInstancePublicConnectionWithOptions(request: AllocateInstancePublicConnectionRequest, runtime: Util.RuntimeOptions): AllocateInstancePublicConnectionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('AllocateInstancePublicConnection', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function allocateInstancePublicConnection(request: AllocateInstancePublicConnectionRequest): AllocateInstancePublicConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return allocateInstancePublicConnectionWithOptions(request, runtime);
}

model CloneDBInstanceRequest {
  autoRenew?: string(name='AutoRenew'),
  autoRenewPeriod?: string(name='AutoRenewPeriod'),
  backupSetId?: string(name='BackupSetId'),
  clientToken?: string(name='ClientToken'),
  DBInstanceCategory?: string(name='DBInstanceCategory'),
  DBInstanceClass?: string(name='DBInstanceClass'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  DBInstanceNetworkType?: string(name='DBInstanceNetworkType'),
  DBInstanceVersion?: string(name='DBInstanceVersion'),
  DBNodeStorage?: string(name='DBNodeStorage'),
  DBNodeStorageType?: string(name='DBNodeStorageType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  restoreTime?: string(name='RestoreTime'),
  restoreType?: string(name='RestoreType'),
  securityIPList?: string(name='SecurityIPList'),
  sourceDBInstanceId?: string(name='SourceDBInstanceId'),
  usedTime?: string(name='UsedTime'),
  VPCId?: string(name='VPCId'),
  vSwitchId?: string(name='VSwitchId'),
  zoneId?: string(name='ZoneId'),
}

model CloneDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  orderId?: string(name='OrderId'),
  requestId?: string(name='RequestId'),
}

model CloneDBInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: CloneDBInstanceResponseBody(name='body'),
}

async function cloneDBInstanceWithOptions(request: CloneDBInstanceRequest, runtime: Util.RuntimeOptions): CloneDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CloneDBInstance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function cloneDBInstance(request: CloneDBInstanceRequest): CloneDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return cloneDBInstanceWithOptions(request, runtime);
}

model CreateAccountRequest {
  accountDescription?: string(name='AccountDescription'),
  accountName?: string(name='AccountName'),
  accountPassword?: string(name='AccountPassword'),
  clientToken?: string(name='ClientToken'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateAccountResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateAccountResponse = {
  headers: map[string]string(name='headers'),
  body: CreateAccountResponseBody(name='body'),
}

async function createAccountWithOptions(request: CreateAccountRequest, runtime: Util.RuntimeOptions): CreateAccountResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateAccount', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createAccount(request: CreateAccountRequest): CreateAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountWithOptions(request, runtime);
}

model CreateDBInstanceRequest {
  autoRenew?: string(name='AutoRenew'),
  autoRenewPeriod?: string(name='AutoRenewPeriod'),
  clientToken?: string(name='ClientToken'),
  DBInstanceCategory?: string(name='DBInstanceCategory'),
  DBInstanceClass?: string(name='DBInstanceClass'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  DBInstanceNetworkType?: string(name='DBInstanceNetworkType'),
  DBInstanceVersion?: string(name='DBInstanceVersion'),
  DBNodeStorage?: string(name='DBNodeStorage'),
  DBNodeStorageType?: string(name='DBNodeStorageType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  payType?: string(name='PayType'),
  period?: string(name='Period'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIPList?: string(name='SecurityIPList'),
  usedTime?: string(name='UsedTime'),
  VPCId?: string(name='VPCId'),
  vSwitchId?: string(name='VSwitchId'),
  zoneId?: string(name='ZoneId'),
}

model CreateDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  orderId?: string(name='OrderId'),
  requestId?: string(name='RequestId'),
}

model CreateDBInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: CreateDBInstanceResponseBody(name='body'),
}

async function createDBInstanceWithOptions(request: CreateDBInstanceRequest, runtime: Util.RuntimeOptions): CreateDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateDBInstance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createDBInstance(request: CreateDBInstanceRequest): CreateDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDBInstanceWithOptions(request, runtime);
}

model CreateReadDBInstanceRequest {
  autoRenew?: string(name='AutoRenew'),
  autoRenewPeriod?: string(name='AutoRenewPeriod'),
  backupSetId?: string(name='BackupSetId'),
  clientToken?: string(name='ClientToken'),
  DBInstanceCategory?: string(name='DBInstanceCategory'),
  DBInstanceId?: string(name='DBInstanceId'),
  DBInstanceNetworkType?: string(name='DBInstanceNetworkType'),
  DBNodeClass?: string(name='DBNodeClass'),
  DBNodeStorage?: string(name='DBNodeStorage'),
  DBNodeStorageType?: string(name='DBNodeStorageType'),
  effectiveTime?: string(name='EffectiveTime'),
  engineVersion?: string(name='EngineVersion'),
  orderParam?: string(name='OrderParam'),
  orderType?: string(name='OrderType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  vSwitchId?: string(name='VSwitchId'),
  vpcId?: string(name='VpcId'),
}

model CreateReadDBInstanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  orderId?: string(name='OrderId'),
  requestId?: string(name='RequestId'),
}

model CreateReadDBInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: CreateReadDBInstanceResponseBody(name='body'),
}

async function createReadDBInstanceWithOptions(request: CreateReadDBInstanceRequest, runtime: Util.RuntimeOptions): CreateReadDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateReadDBInstance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createReadDBInstance(request: CreateReadDBInstanceRequest): CreateReadDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createReadDBInstanceWithOptions(request, runtime);
}

model CreateServiceLinkedRoleRequest {
  clientToken?: string(name='ClientToken'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityToken?: string(name='SecurityToken'),
  serviceName?: string(name='ServiceName'),
}

model CreateServiceLinkedRoleResponseBody = {
  requestId?: string(name='RequestId'),
  role?: {
    role?: [ 
    {
      arn?: string(name='Arn'),
      assumeRolePolicyDocument?: string(name='AssumeRolePolicyDocument'),
      createDate?: string(name='CreateDate'),
      description?: string(name='Description'),
      isServiceLinkedRole?: boolean(name='IsServiceLinkedRole'),
      latestDeletionTask?: boolean(name='LatestDeletionTask'),
      roleId?: string(name='RoleId'),
      roleName?: string(name='RoleName'),
      rolePrincipalName?: string(name='RolePrincipalName'),
    }
  ](name='Role')
  }(name='Role'),
}

model CreateServiceLinkedRoleResponse = {
  headers: map[string]string(name='headers'),
  body: CreateServiceLinkedRoleResponseBody(name='body'),
}

async function createServiceLinkedRoleWithOptions(request: CreateServiceLinkedRoleRequest, runtime: Util.RuntimeOptions): CreateServiceLinkedRoleResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('CreateServiceLinkedRole', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function createServiceLinkedRole(request: CreateServiceLinkedRoleRequest): CreateServiceLinkedRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return createServiceLinkedRoleWithOptions(request, runtime);
}

model DeleteDBInstanceRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDBInstanceResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteDBInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: DeleteDBInstanceResponseBody(name='body'),
}

async function deleteDBInstanceWithOptions(request: DeleteDBInstanceRequest, runtime: Util.RuntimeOptions): DeleteDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DeleteDBInstance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function deleteDBInstance(request: DeleteDBInstanceRequest): DeleteDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDBInstanceWithOptions(request, runtime);
}

model DescribeAccountsRequest {
  accountName?: string(name='AccountName'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeAccountsResponseBody = {
  accounts?: [ 
    {
      accountDescription?: string(name='AccountDescription'),
      accountName?: string(name='AccountName'),
      accountStatus?: string(name='AccountStatus'),
      accountType?: string(name='AccountType'),
    }
  ](name='Accounts'),
  requestId?: string(name='RequestId'),
}

model DescribeAccountsResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeAccountsResponseBody(name='body'),
}

async function describeAccountsWithOptions(request: DescribeAccountsRequest, runtime: Util.RuntimeOptions): DescribeAccountsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeAccounts', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeAccounts(request: DescribeAccountsRequest): DescribeAccountsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAccountsWithOptions(request, runtime);
}

model DescribeAvailableResourceRequest {
  chargeType?: string(name='ChargeType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  zoneId?: string(name='ZoneId'),
}

model DescribeAvailableResourceResponseBody = {
  availableZoneList?: {
    availableZone?: [ 
    {
      supportedSerialList?: {
        supportedSerial?: [ 
        {
          serial?: string(name='Serial'),
          supportedInstanceClassList?: {
            supportedInstanceClass?: [ 
            {
              instanceClass?: string(name='InstanceClass'),
              supportedStorageSizeList?: {
                supportedStorageSize?: [ 
                {
                  storageSize?: {
                    max?: int32(name='Max'),
                    min?: int32(name='Min'),
                    step?: int32(name='Step'),
                  }(name='StorageSize'),
                  storageType?: string(name='StorageType'),
                }
              ](name='SupportedStorageSize')
              }(name='SupportedStorageSizeList'),
              tips?: string(name='Tips'),
            }
          ](name='SupportedInstanceClass')
          }(name='SupportedInstanceClassList'),
        }
      ](name='SupportedSerial')
      }(name='SupportedSerialList'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='AvailableZone')
  }(name='AvailableZoneList'),
  regionId?: string(name='RegionId'),
  requestId?: string(name='RequestId'),
}

model DescribeAvailableResourceResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeAvailableResourceResponseBody(name='body'),
}

async function describeAvailableResourceWithOptions(request: DescribeAvailableResourceRequest, runtime: Util.RuntimeOptions): DescribeAvailableResourceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeAvailableResource', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeAvailableResource(request: DescribeAvailableResourceRequest): DescribeAvailableResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableResourceWithOptions(request, runtime);
}

model DescribeBackupPolicyRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeBackupPolicyResponseBody = {
  backupRetentionPeriod?: int32(name='BackupRetentionPeriod'),
  enableBackupLog?: string(name='EnableBackupLog'),
  logBackupRetentionPeriod?: int32(name='LogBackupRetentionPeriod'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod'),
  preferredBackupTime?: string(name='PreferredBackupTime'),
  requestId?: string(name='RequestId'),
}

model DescribeBackupPolicyResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeBackupPolicyResponseBody(name='body'),
}

async function describeBackupPolicyWithOptions(request: DescribeBackupPolicyRequest, runtime: Util.RuntimeOptions): DescribeBackupPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackupPolicy', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackupPolicy(request: DescribeBackupPolicyRequest): DescribeBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupPolicyWithOptions(request, runtime);
}

model DescribeBackupsRequest {
  backupId?: string(name='BackupId'),
  DBInstanceId?: string(name='DBInstanceId'),
  endTime?: string(name='EndTime'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime'),
}

model DescribeBackupsResponseBody = {
  items?: {
    backup?: [ 
    {
      backupEndTime?: string(name='BackupEndTime'),
      backupId?: string(name='BackupId'),
      backupMethod?: string(name='BackupMethod'),
      backupSize?: long(name='BackupSize'),
      backupStartTime?: string(name='BackupStartTime'),
      backupStatus?: string(name='BackupStatus'),
      backupType?: string(name='BackupType'),
      DBInstanceId?: string(name='DBInstanceId'),
    }
  ](name='Backup')
  }(name='Items'),
  pageNumber?: string(name='PageNumber'),
  pageSize?: string(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: string(name='TotalCount'),
}

model DescribeBackupsResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeBackupsResponseBody(name='body'),
}

async function describeBackupsWithOptions(request: DescribeBackupsRequest, runtime: Util.RuntimeOptions): DescribeBackupsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeBackups', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeBackups(request: DescribeBackupsRequest): DescribeBackupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBackupsWithOptions(request, runtime);
}

model DescribeDBInstanceAccessWhiteListRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceAccessWhiteListResponseBody = {
  items?: {
    DBInstanceIPArray?: [ 
    {
      DBInstanceIPArrayAttribute?: string(name='DBInstanceIPArrayAttribute'),
      DBInstanceIPArrayName?: string(name='DBInstanceIPArrayName'),
      securityIps?: string(name='SecurityIps'),
    }
  ](name='DBInstanceIPArray')
  }(name='Items'),
  requestId?: string(name='RequestId'),
}

model DescribeDBInstanceAccessWhiteListResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeDBInstanceAccessWhiteListResponseBody(name='body'),
}

async function describeDBInstanceAccessWhiteListWithOptions(request: DescribeDBInstanceAccessWhiteListRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceAccessWhiteListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceAccessWhiteList', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceAccessWhiteList(request: DescribeDBInstanceAccessWhiteListRequest): DescribeDBInstanceAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceAccessWhiteListWithOptions(request, runtime);
}

model DescribeDBInstanceAttributeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceAttributeResponseBody = {
  items?: {
    DBInstance?: [ 
    {
      category?: string(name='Category'),
      connectionString?: string(name='ConnectionString'),
      creationTime?: string(name='CreationTime'),
      currentMinorVersion?: string(name='CurrentMinorVersion'),
      DBInstanceCPU?: string(name='DBInstanceCPU'),
      DBInstanceDescription?: string(name='DBInstanceDescription'),
      DBInstanceId?: string(name='DBInstanceId'),
      DBInstanceMemory?: long(name='DBInstanceMemory'),
      DBInstanceNetworkType?: string(name='DBInstanceNetworkType'),
      DBInstanceStatus?: string(name='DBInstanceStatus'),
      DBInstanceStorageType?: string(name='DBInstanceStorageType'),
      DBInstanceType?: string(name='DBInstanceType'),
      DBNodeClass?: string(name='DBNodeClass'),
      DBNodeCount?: long(name='DBNodeCount'),
      DBNodeStorage?: long(name='DBNodeStorage'),
      DBVersion?: string(name='DBVersion'),
      expireTime?: string(name='ExpireTime'),
      expired?: string(name='Expired'),
      latestMinorVersion?: string(name='LatestMinorVersion'),
      lockMode?: string(name='LockMode'),
      lockReason?: string(name='LockReason'),
      maintainTime?: string(name='MaintainTime'),
      masterInstanceId?: string(name='MasterInstanceId'),
      payType?: string(name='PayType'),
      port?: string(name='Port'),
      publicConnectionString?: string(name='PublicConnectionString'),
      publicPort?: int32(name='PublicPort'),
      readOnlyDBInstanceIds?: {
        readOnlyDBInstanceId?: [ 
        {
          DBInstanceId?: string(name='DBInstanceId'),
        }
      ](name='ReadOnlyDBInstanceId')
      }(name='ReadOnlyDBInstanceIds'),
      regionId?: string(name='RegionId'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      vSwitchId?: string(name='VSwitchId'),
      vpcId?: string(name='VpcId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='DBInstance')
  }(name='Items'),
  requestId?: string(name='RequestId'),
}

model DescribeDBInstanceAttributeResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeDBInstanceAttributeResponseBody(name='body'),
}

async function describeDBInstanceAttributeWithOptions(request: DescribeDBInstanceAttributeRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceAttributeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceAttribute', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceAttribute(request: DescribeDBInstanceAttributeRequest): DescribeDBInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceAttributeWithOptions(request, runtime);
}

model DescribeDBInstancePerformanceRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  endTime?: string(name='EndTime'),
  key?: string(name='Key'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime'),
}

model DescribeDBInstancePerformanceResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  endTime?: string(name='EndTime'),
  engine?: string(name='Engine'),
  performanceKeys?: {
    performanceItem?: [ 
    {
      measurement?: string(name='Measurement'),
      metricName?: string(name='MetricName'),
      points?: {
        performanceItemValue?: [ 
        {
          timestamp?: long(name='Timestamp'),
          value?: string(name='Value'),
        }
      ](name='PerformanceItemValue')
      }(name='Points'),
    }
  ](name='PerformanceItem')
  }(name='PerformanceKeys'),
  requestId?: string(name='RequestId'),
  startTime?: string(name='StartTime'),
}

model DescribeDBInstancePerformanceResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeDBInstancePerformanceResponseBody(name='body'),
}

async function describeDBInstancePerformanceWithOptions(request: DescribeDBInstancePerformanceRequest, runtime: Util.RuntimeOptions): DescribeDBInstancePerformanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstancePerformance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstancePerformance(request: DescribeDBInstancePerformanceRequest): DescribeDBInstancePerformanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancePerformanceWithOptions(request, runtime);
}

model DescribeDBInstanceStatusRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeDBInstanceStatusResponseBody = {
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
}

model DescribeDBInstanceStatusResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeDBInstanceStatusResponseBody(name='body'),
}

async function describeDBInstanceStatusWithOptions(request: DescribeDBInstanceStatusRequest, runtime: Util.RuntimeOptions): DescribeDBInstanceStatusResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstanceStatus', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstanceStatus(request: DescribeDBInstanceStatusRequest): DescribeDBInstanceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstanceStatusWithOptions(request, runtime);
}

model DescribeDBInstancesRequest {
  clientToken?: string(name='ClientToken'),
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  DBInstanceIds?: string(name='DBInstanceIds'),
  DBInstanceStatus?: string(name='DBInstanceStatus'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model DescribeDBInstancesResponseBody = {
  items?: {
    DBInstance?: [ 
    {
      category?: string(name='Category'),
      createTime?: string(name='CreateTime'),
      DBInstanceDescription?: string(name='DBInstanceDescription'),
      DBInstanceId?: string(name='DBInstanceId'),
      DBInstanceStatus?: string(name='DBInstanceStatus'),
      DBInstanceType?: string(name='DBInstanceType'),
      DBNodeClass?: string(name='DBNodeClass'),
      DBNodeCount?: long(name='DBNodeCount'),
      DBNodeStorage?: long(name='DBNodeStorage'),
      DBVersion?: string(name='DBVersion'),
      expireTime?: string(name='ExpireTime'),
      expired?: string(name='Expired'),
      lockMode?: string(name='LockMode'),
      lockReason?: string(name='LockReason'),
      masterInstanceId?: string(name='MasterInstanceId'),
      payType?: string(name='PayType'),
      readOnlyDBInstanceIds?: {
        readOnlyDBInstanceId?: [ 
        {
          DBInstanceId?: string(name='DBInstanceId'),
        }
      ](name='ReadOnlyDBInstanceId')
      }(name='ReadOnlyDBInstanceIds'),
      regionId?: string(name='RegionId'),
      tags?: {
        tag?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tag')
      }(name='Tags'),
      vSwitchId?: string(name='VSwitchId'),
      vpcId?: string(name='VpcId'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='DBInstance')
  }(name='Items'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeDBInstancesResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeDBInstancesResponseBody(name='body'),
}

async function describeDBInstancesWithOptions(request: DescribeDBInstancesRequest, runtime: Util.RuntimeOptions): DescribeDBInstancesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeDBInstances', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeDBInstances(request: DescribeDBInstancesRequest): DescribeDBInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDBInstancesWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      regionId?: string(name='RegionId'),
      zones?: {
        zone?: [ 
        {
          vpcEnabled?: boolean(name='VpcEnabled'),
          zoneId?: string(name='ZoneId'),
        }
      ](name='Zone')
      }(name='Zones'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId'),
}

model DescribeRegionsResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeRegions', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeResourceUsageRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeResourceUsageResponseBody = {
  backupSize?: long(name='BackupSize'),
  coldBackupSize?: long(name='ColdBackupSize'),
  DBInstanceId?: string(name='DBInstanceId'),
  dataSize?: long(name='DataSize'),
  diskUsed?: long(name='DiskUsed'),
  engine?: string(name='Engine'),
  logSize?: long(name='LogSize'),
  requestId?: string(name='RequestId'),
}

model DescribeResourceUsageResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeResourceUsageResponseBody(name='body'),
}

async function describeResourceUsageWithOptions(request: DescribeResourceUsageRequest, runtime: Util.RuntimeOptions): DescribeResourceUsageResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeResourceUsage', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeResourceUsage(request: DescribeResourceUsageRequest): DescribeResourceUsageResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeResourceUsageWithOptions(request, runtime);
}

model DescribeSecurityGroupConfigurationRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescribeSecurityGroupConfigurationResponseBody = {
  DBInstanceId?: string(name='DBInstanceId'),
  items?: {
    ecsSecurityGroupRelation?: [ 
    {
      networkType?: string(name='NetworkType'),
      regionId?: string(name='RegionId'),
      securityGroupId?: string(name='SecurityGroupId'),
    }
  ](name='EcsSecurityGroupRelation')
  }(name='Items'),
  requestId?: string(name='RequestId'),
}

model DescribeSecurityGroupConfigurationResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeSecurityGroupConfigurationResponseBody(name='body'),
}

async function describeSecurityGroupConfigurationWithOptions(request: DescribeSecurityGroupConfigurationRequest, runtime: Util.RuntimeOptions): DescribeSecurityGroupConfigurationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeSecurityGroupConfiguration', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeSecurityGroupConfiguration(request: DescribeSecurityGroupConfigurationRequest): DescribeSecurityGroupConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecurityGroupConfigurationWithOptions(request, runtime);
}

model DescribeTagsRequest {
  nextToken?: string(name='NextToken'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceGroupId?: string(name='ResourceGroupId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
}

model DescribeTagsResponseBody = {
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  tags?: {
    tag?: [ 
    {
      tagKey?: string(name='TagKey'),
      tagValues?: {
        tagValue?: [ string ](name='TagValue')
      }(name='TagValues'),
    }
  ](name='Tag')
  }(name='Tags'),
}

model DescribeTagsResponse = {
  headers: map[string]string(name='headers'),
  body: DescribeTagsResponseBody(name='body'),
}

async function describeTagsWithOptions(request: DescribeTagsRequest, runtime: Util.RuntimeOptions): DescribeTagsResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('DescribeTags', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function describeTags(request: DescribeTagsRequest): DescribeTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTagsWithOptions(request, runtime);
}

model ListTagResourcesRequest {
  nextToken?: string(name='NextToken'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model ListTagResourcesResponseBody = {
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  tagResources?: {
    tagResource?: [ 
    {
      resourceId?: string(name='ResourceId'),
      resourceType?: string(name='ResourceType'),
      tagKey?: string(name='TagKey'),
      tagValue?: string(name='TagValue'),
    }
  ](name='TagResource')
  }(name='TagResources'),
}

model ListTagResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: ListTagResourcesResponseBody(name='body'),
}

async function listTagResourcesWithOptions(request: ListTagResourcesRequest, runtime: Util.RuntimeOptions): ListTagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ListTagResources', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function listTagResources(request: ListTagResourcesRequest): ListTagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTagResourcesWithOptions(request, runtime);
}

model ModifyBackupPolicyRequest {
  backupRetentionPeriod?: string(name='BackupRetentionPeriod'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  preferredBackupPeriod?: string(name='PreferredBackupPeriod'),
  preferredBackupTime?: string(name='PreferredBackupTime'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyBackupPolicyResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyBackupPolicyResponse = {
  headers: map[string]string(name='headers'),
  body: ModifyBackupPolicyResponseBody(name='body'),
}

async function modifyBackupPolicyWithOptions(request: ModifyBackupPolicyRequest, runtime: Util.RuntimeOptions): ModifyBackupPolicyResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyBackupPolicy', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyBackupPolicy(request: ModifyBackupPolicyRequest): ModifyBackupPolicyResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBackupPolicyWithOptions(request, runtime);
}

model ModifyDBInstanceAccessWhiteListRequest {
  DBInstanceIPArrayAttribute?: string(name='DBInstanceIPArrayAttribute'),
  DBInstanceIPArrayName?: string(name='DBInstanceIPArrayName'),
  DBInstanceId?: string(name='DBInstanceId'),
  modifyMode?: string(name='ModifyMode'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityIps?: string(name='SecurityIps'),
}

model ModifyDBInstanceAccessWhiteListResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyDBInstanceAccessWhiteListResponse = {
  headers: map[string]string(name='headers'),
  body: ModifyDBInstanceAccessWhiteListResponseBody(name='body'),
}

async function modifyDBInstanceAccessWhiteListWithOptions(request: ModifyDBInstanceAccessWhiteListRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceAccessWhiteListResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceAccessWhiteList', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceAccessWhiteList(request: ModifyDBInstanceAccessWhiteListRequest): ModifyDBInstanceAccessWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceAccessWhiteListWithOptions(request, runtime);
}

model ModifyDBInstanceDescriptionRequest {
  DBInstanceDescription?: string(name='DBInstanceDescription'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceDescriptionResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyDBInstanceDescriptionResponse = {
  headers: map[string]string(name='headers'),
  body: ModifyDBInstanceDescriptionResponseBody(name='body'),
}

async function modifyDBInstanceDescriptionWithOptions(request: ModifyDBInstanceDescriptionRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceDescriptionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceDescription', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceDescription(request: ModifyDBInstanceDescriptionRequest): ModifyDBInstanceDescriptionResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceDescriptionWithOptions(request, runtime);
}

model ModifyDBInstanceMaintainTimeRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  maintainTime?: string(name='MaintainTime'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceMaintainTimeResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyDBInstanceMaintainTimeResponse = {
  headers: map[string]string(name='headers'),
  body: ModifyDBInstanceMaintainTimeResponseBody(name='body'),
}

async function modifyDBInstanceMaintainTimeWithOptions(request: ModifyDBInstanceMaintainTimeRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceMaintainTimeResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceMaintainTime', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceMaintainTime(request: ModifyDBInstanceMaintainTimeRequest): ModifyDBInstanceMaintainTimeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceMaintainTimeWithOptions(request, runtime);
}

model ModifyDBInstanceSpecRequest {
  clientToken?: string(name='ClientToken'),
  DBInstanceClass?: string(name='DBInstanceClass'),
  DBInstanceId?: string(name='DBInstanceId'),
  DBInstanceStorage?: int32(name='DBInstanceStorage'),
  DBInstanceStorageType?: string(name='DBInstanceStorageType'),
  effectiveTime?: string(name='EffectiveTime'),
  engineVersion?: string(name='EngineVersion'),
  orderParam?: string(name='OrderParam'),
  orderType?: string(name='OrderType'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyDBInstanceSpecResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyDBInstanceSpecResponse = {
  headers: map[string]string(name='headers'),
  body: ModifyDBInstanceSpecResponseBody(name='body'),
}

async function modifyDBInstanceSpecWithOptions(request: ModifyDBInstanceSpecRequest, runtime: Util.RuntimeOptions): ModifyDBInstanceSpecResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifyDBInstanceSpec', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifyDBInstanceSpec(request: ModifyDBInstanceSpecRequest): ModifyDBInstanceSpecResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyDBInstanceSpecWithOptions(request, runtime);
}

model ModifySecurityGroupConfigurationRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  securityGroupId?: string(name='SecurityGroupId'),
}

model ModifySecurityGroupConfigurationResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifySecurityGroupConfigurationResponse = {
  headers: map[string]string(name='headers'),
  body: ModifySecurityGroupConfigurationResponseBody(name='body'),
}

async function modifySecurityGroupConfigurationWithOptions(request: ModifySecurityGroupConfigurationRequest, runtime: Util.RuntimeOptions): ModifySecurityGroupConfigurationResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ModifySecurityGroupConfiguration', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function modifySecurityGroupConfiguration(request: ModifySecurityGroupConfigurationRequest): ModifySecurityGroupConfigurationResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifySecurityGroupConfigurationWithOptions(request, runtime);
}

model ResetAccountPasswordRequest {
  accountName?: string(name='AccountName'),
  accountPassword?: string(name='AccountPassword'),
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ResetAccountPasswordResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetAccountPasswordResponse = {
  headers: map[string]string(name='headers'),
  body: ResetAccountPasswordResponseBody(name='body'),
}

async function resetAccountPasswordWithOptions(request: ResetAccountPasswordRequest, runtime: Util.RuntimeOptions): ResetAccountPasswordResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('ResetAccountPassword', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function resetAccountPassword(request: ResetAccountPasswordRequest): ResetAccountPasswordResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAccountPasswordWithOptions(request, runtime);
}

model RestartDBInstanceRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model RestartDBInstanceResponseBody = {
  requestId?: string(name='RequestId'),
}

model RestartDBInstanceResponse = {
  headers: map[string]string(name='headers'),
  body: RestartDBInstanceResponseBody(name='body'),
}

async function restartDBInstanceWithOptions(request: RestartDBInstanceRequest, runtime: Util.RuntimeOptions): RestartDBInstanceResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('RestartDBInstance', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function restartDBInstance(request: RestartDBInstanceRequest): RestartDBInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return restartDBInstanceWithOptions(request, runtime);
}

model TagResourcesRequest {
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
}

model TagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: TagResourcesResponseBody(name='body'),
}

async function tagResourcesWithOptions(request: TagResourcesRequest, runtime: Util.RuntimeOptions): TagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('TagResources', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function tagResources(request: TagResourcesRequest): TagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesWithOptions(request, runtime);
}

model UntagResourcesRequest {
  all?: boolean(name='All'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  regionId?: string(name='RegionId'),
  resourceId?: [ string ](name='ResourceId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  resourceType?: string(name='ResourceType'),
  tagKey?: [ string ](name='TagKey'),
}

model UntagResourcesResponseBody = {
  requestId?: string(name='RequestId'),
}

model UntagResourcesResponse = {
  headers: map[string]string(name='headers'),
  body: UntagResourcesResponseBody(name='body'),
}

async function untagResourcesWithOptions(request: UntagResourcesRequest, runtime: Util.RuntimeOptions): UntagResourcesResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UntagResources', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function untagResources(request: UntagResourcesRequest): UntagResourcesResponse {
  var runtime = new Util.RuntimeOptions{};
  return untagResourcesWithOptions(request, runtime);
}

model UpgradeDBInstanceKernelVersionRequest {
  DBInstanceId?: string(name='DBInstanceId'),
  ownerAccount?: string(name='OwnerAccount'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  switchTime?: string(name='SwitchTime'),
  switchTimeMode?: string(name='SwitchTimeMode'),
}

model UpgradeDBInstanceKernelVersionResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpgradeDBInstanceKernelVersionResponse = {
  headers: map[string]string(name='headers'),
  body: UpgradeDBInstanceKernelVersionResponseBody(name='body'),
}

async function upgradeDBInstanceKernelVersionWithOptions(request: UpgradeDBInstanceKernelVersionRequest, runtime: Util.RuntimeOptions): UpgradeDBInstanceKernelVersionResponse {
  Util.validateModel(request);
  var req = new OpenApi.OpenApiRequest{ 
    body = Util.toMap(request),
  };
  return doRPCRequest('UpgradeDBInstanceKernelVersion', '2019-09-03', 'HTTPS', 'POST', 'AK', 'json', req, runtime);
}

async function upgradeDBInstanceKernelVersion(request: UpgradeDBInstanceKernelVersionRequest): UpgradeDBInstanceKernelVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeDBInstanceKernelVersionWithOptions(request, runtime);
}

